cmake_minimum_required(VERSION 3.5)

project(gbm_eglimage_opengl VERSION 0.1 LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_PREFIX_PATH /home/bobbi/Qt6_4_2/lib/cmake)

find_package(Qt6 COMPONENTS
        Core
        Gui
        Widgets
#        Multimedia
        WaylandClient
        OpenGL
        OpenGLWidgets
        )

find_package(PkgConfig)
pkg_check_modules(EGL IMPORTED_TARGET egl)
pkg_check_modules(DRM IMPORTED_TARGET libdrm)
pkg_check_modules(GBM IMPORTED_TARGET gbm)

set(PROJECT_SOURCES
        main.cpp
        mywidget.cpp
        mywidget.h
        decoder.h
        decoder.cpp
        my_shader.h
        )

add_executable(${PROJECT_NAME}
        ${PROJECT_SOURCES}
        )

target_link_libraries(${PROJECT_NAME}
        PUBLIC
        Qt::Core
        Qt::Widgets
        Qt::Gui
        Qt::GuiPrivate
        Qt::WaylandClient
        Qt::OpenGL
        Qt::OpenGLWidgets
        PkgConfig::EGL
        PkgConfig::DRM
        PkgConfig::GBM
        )
